[Repo Assist] test: add 48 unit tests for StringExtensions#1759
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Draft
[Repo Assist] test: add 48 unit tests for StringExtensions#1759github-actions[bot] wants to merge 2 commits intomainfrom
github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
CsvExtensions.StringExtensions is a public API that wraps TextConversions methods as extension methods on System.String, throwing on failure instead of returning None. These extensions had no dedicated unit tests; this adds coverage for all 9 methods: AsInteger, AsInteger64, AsDecimal, AsFloat, AsBoolean, AsDateTime, AsDateTimeOffset, AsTimeSpan, AsGuid. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This is an automated pull request from Repo Assist, an AI assistant for this repository.
FSharp.Data.StringExtensions(insrc/FSharp.Data.Csv.Core/CsvExtensions.fs) is a public API providing extension methods onSystem.Stringthat callTextConversionsmethods and throw on failure rather than returningNone. WhileTextConversionsitself has thorough tests, the extension layer had no dedicated unit tests.Changes
tests/FSharp.Data.Core.Tests/StringExtensions.fs— 48 new tests covering all 9 extension methods:AsInteger/AsInteger64— valid inputs, culture parameter, throw on invalid inputAsDecimal— valid inputs, culture-specific decimal separatorAsFloat— valid inputs, default missing-value strings ("N/A","NA") →NaN, custom missing values, throw on non-numericAsBoolean— recognised true/false values, throw on unrecognised inputAsDateTime/AsDateTimeOffset/AsTimeSpan— valid ISO strings, throw on invalidAsGuid— standard and braced form, throw on invalidTest Status
dotnet test tests/FSharp.Data.Core.Tests/ --filter StringExtensions— 48 passed, 0 faileddotnet run --project build/build.fsproj -t Build) fails with NU1902 (pre-existing infrastructure issue:OpenTelemetry.Api 1.15.0has an unpatched moderate vulnerability brought in transitively byNUnit3TestAdapter; no patched version is available yet). This is not caused by these changes.